perm filename NEWDO.MLB[UP,DOC] blob
sn#437075 filedate 1979-04-30 generic text, type C, neo UTF8
COMMENT ⊗ VALID 00003 PAGES
C REC PAGE DESCRIPTION
C00001 00001
C00002 00002 DO PROGRAM EXTENSIONS -- MLB 1 May 79
C00011 00003 EXAMPLES OF EXTENDED DO
C00015 ENDMK
C⊗;
DO PROGRAM EXTENSIONS -- MLB 1 May 79
This section documents some newly implemented extensions to the DO
program. Some of these "features" may be flushed, new ones may be added,
others modified. Since the DO program is inherently limited in its
usefulness some of these bells and whistles may be of fairly dubious
utility. The next page provides some examples.
THE BRICK
To use the new DO features you must specify a special escape character.
Following the POX convention we will call this escape character the
"brick". In the following, we will use the backslash character "\" as the
brick character in examples of the new features. We will also use BNF
style angle brackets to enclose syntactic entities, for example, <char>
will be used to denote any character.
To specify a brick character use the sequence
?\<char>
This makes the <char> the brick character. For example, to specify
backslash as the brick character use
?\\
Previously, ?\ would have been processed as a variable name command (cf
earlier DO documentation). This sequence is no longer available for this
purpose. This is the only (downwards) incompatibility with the old DO
program.
BRICK COMMAND SYNTAX
The brick character appears as the first character of all the new
commands. Subsequent characters are scanned to determine the command and
to get any needed arguments, etc. Then normal processing is resumed until
the brick character is encountered again.
If the command is denoted by a special keyword the keyword is delimited on
the right by a dot character "." and may be in upper and/or lower case
letters.
BRICK COMMAND DESCRIPTIONS
The following commands will be grouped in terms of related function.
SPECIAL CHARACTER GENERATION
These commands are used to cause special characters to appear in the
output. They are somewhat redundant. They mostly provide alternates for
the regular DO commands without using obscure characters themselves.
\CR. Return (same as ↔)
\LF. Line (same as ↓)
\ALT. Alt (same as ≠)
\TAB. Tab
\VT. Vertical tab
\FF. Form
\BS. Backspace
\C. Add control bit to following character (same as α and VT)
\M. Add meta bit to following character (same as β and FORM)
\CM. Add both control and meta bits to following character
\"<char> Quotes <char> (like ≡)
THIS COMMAND WILL NOT QUOTE A VERTICAL BAR CHARACTER
\'<octal> Generate character with given <octal> code number
\=<decimal> Generate character with given <decimal> code number
(In rare cases the user may need to delimit the numbers with \.)
\↑<char> Generate uparrow style character (eg \↑G gets π)
\?<char> Generate SOS style character (eg \?G gets lower case g)
SYSTEM CHARACTER GENERATION
\CALL. Generates a deferred call (same as λ)
\ESC. Preceeds an ESC or BREAK command (same as ⊗)
Note: WAITS restricts which escape commands are allowed.
Also, they are done when scanned and not passed on.
\CLEAR. Clears the input buffer (with a CLRBUF UUO).
ACTIVATION TABLE MANIPULATION
These commands alter your activation table with the SETACT UUO. This is
mostly useful for bypassing the line editor for programs (eg RAID) which
use lots of control characters which are also line editor commands.
\NOLINED. Suppresses the line editor (sets the ALLACT bit)
\LINED. Unsuppresses the line editor (clears the ALLACT bit)
\NOCONBLT. Suppresses control B, L and T only (sets the SUPCT bit)
\CONBLT. Unsuppresses control B, L and T only (clears the SUPCT bit)
BRICK CHARACTER MANIPULATION
Actually, ?\<char> pushes the old brick on a stack. Hence:
\POPBRICK. Pops the old brick off the stack and makes it the brick
PRINTING
\PRINT.<char><string-sans-char><char>
This command provides a limited printing capability. It cannot print
characters such as RETURN normally since these are removed from the input
earlier in the scan.
\NEWLINE. Prints a CR followed by an LF.
MACRO VARIABLE COMMANDS
There is a set of 128 string variables, whose names are the corresponding
character. In normal mode scanning these are set with the ?<char>
command. The following commands allow a limited ammount of manipulation
of these strings. The symbol <macro> will stand for the character which
is the name of the macro variable.
\←<macro><char><string-sans-char><char> Sets <macro> to delimited string
\INPUT.<macro> Inputs <macro> from the terminal
\&<macro1><macro2><macro3> Like SAIL macro1 ← macro2 & macro3
\INSERT.<macro> Patches <macro> directly into the output, unlike
the ?<macro> command which causes it to be rescanned
\PUSHOUT.<macro> Causes subsequent output to be appended to <macro>
\POPOUT. Returns to previous output destination
SYNTACTIC COMMANDS
\. Nothing. (Can be used to delimit numbers)
\;<char><string-sans-char><char> Comment, ignores between <char>s
MISCELLANEOUS COMMANDS
\BEEP. Does a BEEP UUO.
\XYZZY. Magic.
EXAMPLES OF EXTENDED DO
\;; This is a typical comment, delimited by semicolons;
\;; The following generates a string of six equivelance signs (≡'s);
≡≡\"≡\'36\=30\↑↑\?7
\;; Here we push the brick to get a filehack;
?\$ET \MAIL$POPBRICK.
\;; This would allow the user to (say) put downarrows around the
file name without having them turned into LFs by DO;
\PRINT."Filename, please: "\INPUT.F\INSERT.F
\;; The following uses macro output to reprint its input before DOing it;
\NEWLINE.\PRINT."Type something for me to DO: "\;; prompt user;
\INPUT.A\;; get do string;
\PUSHOUT.B\;; start output to B;
\"\NEWLINE.\"\PRINT.*OK, I will DO \;; set B to start of a print command;
\INSERT.A*\"\NEWLINE.\;; insert A, finish print command;
\POPOUT.\;; return to normal output;
?B\;; do print command;
?A\;; do input thing;